﻿<%@ Page MasterPageFile="~/Site.Master" Language="C#" AutoEventWireup="true" CodeBehind="Lookup.aspx.cs" Inherits="Omu.AwesomeWebFormsDemo.Lookup" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <h1>Lookup</h1>
    <p class="xpl">a readonly field with a button near it, on button click a window pops up, where user can search and select a value</p>
    <h2>
            Lookup with pagination (more results button)
        </h2>
        
        <o:Lookup runat="server" ID="loko" GetUrl="~/svc/aja.svc/FruitGet" SearchUrl='~/svc/aja.svc/FruitSearch' Value="1" />
            
             <h2>
            bound to ajaxdropdown using parentId</h2>
        unlike the AjaxDropdown the Multilookup will keep its value when the value of its
        parent is changed<br />
        can be bound to anything else HiddenField, TextBox, Multilookup etc.<br />
        <o:AjaxDropdown runat="server" ID="Categories" Url="~/svc/aja.svc/CategoriesDropdown">
        </o:AjaxDropdown>
        <br />
        <%
            FruitsByCategory.ParentId = Categories.ClientID;
        %>
        <o:Lookup runat="server" ID="FruitsByCategory" GetUrl="~/svc/aja.svc/FruitGet"
            SearchUrl='~/svc/aja.svc/FruitsByCategorySearch' ClearButton="true" Value="3"/>
            
            <h2>
            Bound to 2 dropdowns (using Data)</h2>
        <o:AjaxDropdown runat="server" ID="Cat1" Url="~/svc/aja.svc/CategoriesDropdown">
        </o:AjaxDropdown>
        <o:AjaxDropdown runat="server" ID="Cat2" Url="~/svc/aja.svc/CategoriesDropdown">
        </o:AjaxDropdown>
        <%
            FruitFrom2Cat.Data = new Dictionary<string, string>
                                      {
                                          {"cat1", Cat1.ClientID},
                                          {"cat2", Cat2.ClientID},
                                      };
%>
        <o:Lookup runat="server" ID="FruitFrom2Cat" GetUrl="~/svc/aja.svc/FruitGet"
            SearchUrl='~/svc/aja.svc/FruitsFrom2CatSearch' Value="2" />
            <h2>send predefined parameters, and fullscreen</h2>
            <%
                FruitsByCategoryPar.Parameters = new Dictionary<string, string>{{"parent","3"}};
                 %>
            <o:Lookup runat="server" ID="FruitsByCategoryPar" GetUrl="~/svc/aja.svc/FruitGet"
            SearchUrl='~/svc/aja.svc/FruitsByCategorySearch'
            FullScreen="true" Modal="false" />       
            
        <br />
        <br />
        <asp:Button ID="Button1" runat="server" Text="Submit" />
</asp:Content>